﻿using System;
using System.Collections;
using System.Data;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using Skyworth.CRM.Service.Entity;
using Skyworth.CRM.Common;
using Skyworth.CRM.Service.IDAL;
using Skyworth.CRM.Service.IBLL;


namespace Skyworth.CRM.BLL
{
    public class WeekLongBLL : IWeekLongBLL
    {
        private IWeekLongDAL _weekLongDAL;

        public WeekLongBLL(IWeekLongDAL weekLongDAL)
        {
            _weekLongDAL = weekLongDAL;
        }


        public void Add(WeekLong wldm, WeekLongEntry ewldm)
        {
            _weekLongDAL.Add(wldm,ewldm);
        }


       public DataTable GetWeekLongByPage(string strWhere, string strOrderBy, int pageIndex, int pageSize, out int recordCount, out int pageCount)
       {
           return _weekLongDAL.GetWeekLongByPage(strWhere, strOrderBy, pageIndex, pageSize, out recordCount,
                                                     out pageCount);
       }

       public void InsertCredit(Int32 FCreditType, Int32 Fcustid, Int32 Ftype, DateTime FBeginDate, DateTime FEndDate, decimal Famount, Int32 FCreditWay, decimal FYearAmount, Int32 FisYes)
       {
           _weekLongDAL.InsertCredit(FCreditType, Fcustid, Ftype, FBeginDate, FEndDate, Famount, FCreditWay, FYearAmount, FisYes);
       }

       //public void UpdateCredit(Int32 Fitemid, Int32 FCreditType, Int32 Fcustid, Int32 Ftype, DateTime FBeginDate, DateTime FEndDate, decimal Famount, Int32 FCreditWay, decimal FYearAmount, Int32 FisYes)
       //{
       //    _weekLongDAL.UpdateCredit(Fitemid, FCreditType, Fcustid, Ftype, FBeginDate, FEndDate, Famount, FCreditWay, FYearAmount, FisYes);
       //}

       public DataTable GetCreditByPage(string strWhere, string strOrderBy, int pageIndex, int pageSize, out int recordCount, out int pageCount)
       {
           return _weekLongDAL.GetCreditByPage(strWhere, strOrderBy, pageIndex, pageSize, out recordCount,
                                                     out pageCount);
       }

       public DataTable QueryCredit(string strWhere)
       {
           return _weekLongDAL.QueryCredit(strWhere);
       }

       public DataTable QueryCash(string strWhere)
       {
           return _weekLongDAL.QueryCash(strWhere);
       }

       public void InsertMoney(Int32 FmoneyType, Int32 Fcustid, DateTime FBeginDate, DateTime FEndDate, decimal Famount, Int32 FisYes, string Fbillno, Int32 Ftype, Int32 Fcashtype)
       {
           _weekLongDAL.InsertMoney(FmoneyType, Fcustid, FBeginDate, FEndDate, Famount, FisYes, Fbillno, Ftype, Fcashtype);
       }

       //public void UpdateMoney(Int32 Fitemid, Int32 FmoneyType, Int32 Fcustid, DateTime FBeginDate, DateTime FEndDate, decimal Famount, Int32 FisYes, string Fbillno, Int32 Ftype, Int32 Fcashtype)
       //{
       //    _weekLongDAL.UpdateMoney(Fitemid, FmoneyType, Fcustid, FBeginDate, FEndDate, Famount, FisYes, Fbillno, Ftype, Fcashtype);
       //}

       public DataTable GetMoneyByPage(string strWhere, string strOrderBy, int pageIndex, int pageSize, out int recordCount, out int pageCount)
       {
           return _weekLongDAL.GetMoneyByPage(strWhere, strOrderBy, pageIndex, pageSize, out recordCount,
                                                     out pageCount);
       }

       public DataTable QueryMoney(string strWhere)
       {
           return _weekLongDAL.QueryMoney(strWhere);
       }


       public void AddSpecial(Special wldm, SpecialEntry ewldm)
       {
           _weekLongDAL.AddSpecial(wldm, ewldm);
       }

       public DataTable GetSpecialByPage(string strWhere, string strOrderBy, int pageIndex, int pageSize, out int recordCount, out int pageCount)
       {
           return _weekLongDAL.GetSpecialByPage(strWhere, strOrderBy, pageIndex, pageSize, out recordCount,
                                                     out pageCount);
       }

       public void DeleteCredit(int nFitemid, int nFcustid, int nFtype, decimal deFamount)
       {
           _weekLongDAL.DeleteCredit(nFitemid, nFcustid, nFtype, deFamount);
       }

       public void DeleteMoney(int nFitemid, int nFcustid, decimal deFamount)
       {
           _weekLongDAL.DeleteMoney(nFitemid, nFcustid, deFamount);
       }

       public DataTable GetCustomerMoneyByPage(string strWhere, string strOrderBy, int pageIndex, int pageSize, out int recordCount, out int pageCount)
       {
           return _weekLongDAL.GetCustomerMoneyByPage(strWhere, strOrderBy, pageIndex, pageSize, out recordCount,
                                                     out pageCount);
       }

       public DataTable GetCustomerMoneyItemByPage(string strWhere, string strOrderBy, int pageIndex, int pageSize, out int recordCount, out int pageCount)
       {
           return _weekLongDAL.GetCustomerMoneyItemByPage(strWhere, strOrderBy, pageIndex, pageSize, out recordCount,
                                                               out pageCount);
       }

       public DataTable QueryCustomerMoney(string strWhere)
       {
           return _weekLongDAL.QueryCustomerMoney(strWhere);
       }

       public void UpdateMoney(int nFitemid, decimal deFCashAmount, decimal deFcreditAmount)
       {
           _weekLongDAL.UpdateMoney(nFitemid,  deFCashAmount,  deFcreditAmount);
       }

       public DataTable GetReceivablesByPage(string strWhere, string strOrderBy, int pageIndex, int pageSize, out int recordCount, out int pageCount)
       {
           return _weekLongDAL.GetReceivablesByPage(strWhere, strOrderBy, pageIndex, pageSize, out recordCount,
                                                                        out pageCount);
       }

       public void InsertReceivables(Int32 FcustType, Int32 Fcustid, DateTime FReceDate, string Fnode, decimal Famount, Int32 FReceivablesType, string FHuiNumber, Int32 FisYes)
       {
           _weekLongDAL.InsertReceivables(FcustType, Fcustid, FReceDate, Fnode, Famount, FReceivablesType, FHuiNumber, FisYes);
       }

       public void DeleteReceivables(int nFitemid, int nFcustid, decimal deFamount)
       {
           _weekLongDAL.DeleteReceivables(nFitemid, nFcustid, deFamount);
       }

       public void InsertRebate(Int32 FcustType, Int32 Fcustid, DateTime FRebateDate, string Fnode, decimal Famount, Int32 FisYes)
       {
           _weekLongDAL.InsertRebate(FcustType, Fcustid, FRebateDate, Fnode, Famount, FisYes);
       }

       public DataTable GetRebateByPage(string strWhere, string strOrderBy, int pageIndex, int pageSize, out int recordCount, out int pageCount)
       {
           return _weekLongDAL.GetRebateByPage(strWhere, strOrderBy, pageIndex, pageSize, out recordCount,
                                                                                out pageCount);
       }
       public void DeleteRebate(int nFitemid, int nFcustid, decimal deFamount)
       {
           _weekLongDAL.DeleteRebate(nFitemid, nFcustid, deFamount);
       }

    }
}
